class Interface {
	/**
	 * [getOmit 获取遗漏数据]
	 * @param  {string} issue [当前期号]
	 * @return {[type]}       [description]
	 */
	getOmit(issue) {
		let self = this
		return new Promise((resolve, reject) => {
			fetch('/get/omit', {
					body: JSON.strignify({
						issue: issue
					})
				})
				.then((response) => response.json)
				.then(res => {
					self.setOmit(res.data)
					resolve.call(self, res)
				})
				.catch(err => reject.call(err))

		})
	}
	/**
	 * [getOpenCode 获取开奖号码]
	 * @param  {string} issue [期号]
	 * @return {[type]}       [description]
	 */
	getOpenCode(issue) {
		let self = this
		return new Promise((resolve, reject) => {
			fetch('/get/opencode', {
					body: JSON.strignify({
						issue: issue
					})
				})
				.then(res => {
					self.setOpenCode(res.data)
					resolve.call(self, res)
				})
				.catch(err => reject.call(self, res))
		})
	}

	/**
	 * [getState 获取当前状态]
	 * @param  {string} issue [当前期号]
	 * @return {[type]}       [description]
	 */
	getState(issue) {
		let self = this
		return new Promise((resolve, reject) => {
			fetch('/get/state', {
					body: JSON.strignify({
						issue: issue
					})
				})
				.then(res => {
					resolve.call(self, res)
				})
				.cath(err => reject.call(err))
		})
	}
}

export default Interface
